package qc.common.core.utils;

import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;

/**
 * 加密工具类
 *
 * @author QuCheng Tech
 * @since 2023/9/6
 */
public class EncryptUtil {
    /**
     * MD5加密
     *
     * @param str 要加密的明文
     * @return java.lang.String
     * @author QuCheng Tech
     * @since 2023/9/6
     */
    public static String md5(String str) {
        return DigestUtils.md5DigestAsHex(str.getBytes(StandardCharsets.UTF_8));
    }
}
